import React from 'react';
import {
    View,
    StyleSheet
} from 'react-native';
import { screen } from '../../public/common';
import MenuItem from './MenuItem';
export default class MenuView extends React.Component {
    constructor(props){
        super(props);
        this.state ={
            menuList:[
                {title:'极速贷款',icon:require('../../images/home/jishudaikuan.jpg'),type:'lessloan'},
                {title:'大额贷款',icon:require('../../images/home/daerdaikuan.jpg'),type:'largeloan'},
                {title:'贷款大全',icon:require('../../images/home/daikuandaquan.png'),type:null},
                {title:'最新上线',icon:require('../../images/home/zuixinshangxian.jpg'),type:null},
            ],
        }
    }
    render() {
        let {menuList} = this.state;
        return <View style={styles.itemsView} >
            {menuList.map((info ,i)=>(
                    <MenuItem
                        {...this.props}
                        key={i}
                        title={info.title}
                        icon={info.icon}
                        type={info.type}
                    />
            ))}
        </View>
    }
}
const styles = StyleSheet.create({
    itemsView: {
        flexDirection: 'row',
        flexWrap: 'wrap',
        width: screen.width,
    },
});